package com.yhao.stocknew.scheduler;

import com.yhao.stocknew.common.service.THSService;
import com.yhao.stocknew.common.utils.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author : yhao
 * @Date : 2023/12/15 - 15:04
 * @Desc : TODO
 */
@Component
@Slf4j
public class DayInfoScheduler {

    @Autowired
    private THSService thsService;

    @Scheduled(cron = "0 30 15 ? * MON-FRI")
    public void getDayInfo() {
        int pageCount = 264;
        String baseUrl = "https://q.10jqka.com.cn/index/index/board/all/field/zdf/order/desc/page/";
        thsService.getDayInfo(pageCount, baseUrl);
        log.info("每只股票当日数据执行完成" + DateUtil.getCommonDate());
    }
}